home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: netcom.com!marnold
- From: marnold@netcom.com (Matt Arnold)
- Subject: Re: The STL and nested structures
- Message-ID: <marnoldDpvnI6.FwC@netcom.com>
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
- References: <4ju9q7$fa1$1@mhadg.production.compuserve.com> <316a26d7.2989288@news.cyberport.com> <marnoldDpn0HH.3z2@netcom.com> <3170bdd7.308224233@news.cyberport.com>
- Date: Mon, 15 Apr 1996 00:18:05 GMT
- Sender: marnold@netcom18.netcom.com
-
- tangent@cyberport.com (Warren Young) writes:
-
- >marnold@netcom.com (Matt Arnold) wrote:
-
- >>>>I am having a problem using the STL with structures defined within
- >>>>a class definition. Consider the following code fragment.
- >>>>...
- >>>>The compiler I am using (VC 4.1) refuses to compile. An error is
- >>>>generated the says "'Foo' : undeclared identifier" at line 75 in
- >>>>vector.h.
- >>
- >>>It _is_ undeclared, just as a variable local to a function foo() is
- >>>undeclared in a function bar(). What you want to say is:
- >>
- >>This should not be necessary. Nested class Foo should be visible for
- >>use in template member Bar::fooContainer. fooContainer is in Bar's
- >>scope. There should be no problem referring to it within Bar.
-
- >Yep, you're right. I didn't look at the code carefully enough.
-
- >>I think Visual C++ is broken on the above code. It compiles fine in
- >>Borland C++.
-
- >Once again, I'm pulled back from the MS abyss...
-
- >>>Even this won't work until Foo is placed in the public section of the
- >>>class (as shown above, it's in the private (default) section).
- >>
- >>That requirement would make private nested implementation class'
- >>impossible, wouldn't it?
-
- >Assuming he was declaring the vector outside the class's scope, I was
- >right. Once you get the straight dope on that, and the rest of the
- >post is rubbish. It all depended on that one premise.
-
- >>Is it true that STL is currently incorrectly implemented?
-
- >By who, and in what regard? I hadn't heard anything of this. Unless
-
- I meant, because STL uses private nested classes employed as template
- parameters for other elements of the nesting classes, your original
- premise implied that STL must rely on incorrect compiler behavior. I
- made this comment simply as an example to back up my assertion that
- your premise was in error. That's all, I didn't mean to imply that
- STL was actually incorrectly implemented.
-
- Regards,
- -------------------------------------------------------------------------
- Matt Arnold | | ||| | |||| | | | || ||
- marnold@netcom.com | | ||| | |||| | | | || ||
- Boston, MA | 0 | ||| | |||| | | | || ||
- 617.389.7384 (h) 617.576.2760 (w) | | ||| | |||| | | | || ||
- C++, MIDI, Win32/95 developer | | ||| 4 3 1 0 8 3 || ||
- -------------------------------------------------------------------------
-
-
-